#include<iostream>
#include<cstring>
using namespace std;
class Person
{
	private:
		char name[20];
		char sex[7];
		int age;
	public:
		void SetPerson()
		{
			cout<<"name:"<<endl;
			cin>>name;
			cout<<"sex:"<<endl;
			cin>>sex;
			cout<<"age:"<<endl;
			cin>>age;
		}
		void DisplayPerson()
		{
			cout<<"Name:"<<name<<endl;
			cout<<"Sex:"<<sex<<endl;
			cout<<"Age:"<<age<<endl;
		}
};
class Teacher:public Person
{
	private:
		char PositionTitle[20];
		char Office[20];
		char Cources[20];
	public:
		void DisplayTeacher()
		{
			this->DisplayPerson();
			cout<<"Position Title:"<<this->PositionTitle<<endl;
			cout<<"Office:"<<this->Office<<endl;
			cout<<"Cources:"<<this->Cources<<endl;
		}
		void SetTeacher()
		{
			this->SetPerson();
			cout<<"Position Title:"<<endl;
			cin>>PositionTitle;
			cout<<"Office"<<endl;
			cin>>Office;
			cout<<"Cources:"<<endl;
			cin>>Cources;
		}
};
class Student:public Person
{
	private:
		char Major[20];
		char Class[20];
		int No;
	public:
		void SetStudent()
		{
			this->SetPerson();
			cout<<"Major:"<<endl;
			cin>>Major;
			cout<<"Class:"<<endl;
			cin>>Class;
			cout<<"No:"<<endl;
			cin>>No;
		}
		void DisplayStudent()
		{
			this->DisplayPerson();
			cout<<"Major:"<<Major<<endl;
			cout<<"Class:"<<Class<<endl;
			cout<<"No:"<<No<<endl;
		}
};
int main()
{
	Teacher T_a;
	T_a.SetTeacher();
	T_a.DisplayTeacher();
	Student S_a;
	S_a.SetStudent();
	S_a.DisplayStudent();
	return 0;
}
